package org.yray.serializer.kryo;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.Serializer;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;

public class KryoSerializer extends Serializer<KryoVo> {
    @Override
    public void write(Kryo kryo, Output output, KryoVo object) {
        output.writeString(object.getFieldName());

    }

    @Override
    public KryoVo read(Kryo kryo, Input input, Class< KryoVo> type) {
        String fieldName = input.readString();
        KryoVo kryoVo =new  KryoVo();
        kryoVo.setFieldName(fieldName);
        return kryoVo;
    }
}